/*
 * 肤质数据报告模块
 * @Author: ljb
 * @Date: 2018-06-08 09:12:09
 * @Last Modified by: ljb
 * @Last Modified time: 2018-09-27 11:10:03
 */
let user_infos = {};

try {
	user_infos = JSON.parse(sessionStorage.getItem('user_infos'));
} catch (error) {
	user_infos = {};
}

export default {

	namespaced: true,

	state: {
		user_infos: user_infos || {},
	},

	mutations: {
		setUserInfos(state, user_info) {
			state.user_infos = user_info;

			sessionStorage.setItem('user_infos', JSON.stringify(user_info));
		},
		clearUserInfos(state) {
			/* eslint-disable-next-line no-param-reassign */
			state.user_infos = [];
		},
	},

	actions: {

	},

	getters: {
		getUserInfos(state) {
			return state.user_infos;
		},
	},
};
